package com.ndp.fb.rdb.model;

import com.ndp.fb.rdb.annotation.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by Sisi on 14-10-19.
 * 字段不全需要和Rock定
 * <p/>
 * <p/>
 * id
 * product_conf_id
 * user_id
 * publish_batch_name
 * connection_object_name
 * configuration
 * create_time
 * image_info
 * bid_info
 * start_time
 * end_time
 * start_utc_time
 * end_utc_time
 * daily_budget
 * lifetime_budget
 * custom_message
 * cpa
 * user_audience_id
 * time_zone
 * connection_object_id
 * publish_status
 * all_campaign_count
 * all_account_count
 * all_adset_count
 * all_adgroup_count
 * all_adcreative_count
 * continue_time
 * retry_cnt
 * retry_time
 * fail_type
 */
@Setter
@Getter
@NoArgsConstructor
@Table("publish_batch")
public class PublishBatch implements Serializable {
    private static final long serialVersionUID = 1981978182251934531L;
    @Id
    private Long id;
    /**
     * userId : PublishBatch -- 1:M
     */
    private String userId;
    //product_conf_id
    private Long productConfId;
    //publish_batch_name
    private String publishBatchName;
    //connection_object_id
    private Long connectionObjectId;
    //connection_object_name
    private String connectionObjectName;
    //configuration
    private String configuration;
    /**
     * isControl--是否配置了控制规则
     */
    @NoSave
    private Boolean isControl;
    @Column(type = ColumnType.Time)
    //create_time
    private Date createTime;
    //image_info
    private String imageInfo;

    /**
     * by 出价预算优化 出价与预算关系--对应
     */
    //bid_info
    private String bidInfo;
    @Column(type = ColumnType.Time)
    private Date startTime;
    @Column(type = ColumnType.Time)
    private Date endTime;
    //start_utc_time
    private Long startUtcTime;
    //end_utc_time
    private Long endUtcTime;
    //daily_budget
    private Integer dailyBudget;
    //lifetime_budget
    private Integer lifetimeBudget;
    //custom_message
    private String customMessage;
    //cpa
    private Integer cpa;
    //user_audience_id
    private Long userAudienceId;
    @Column("time_zone")
    private String timezone;
    /**
     * Evan 2014-12-24 发布广告 新增发布广告 0待发布 1正在发布 2 发布成功 3发布失败   4组装发布广告临时状态
     */
    private Integer publishStatus;

    /**
     * Add by Evan 2015-07-10 新增重试次数
     */
    //retry_cnt
    private Integer retryCnt;

    @Column(type = ColumnType.Time)
    //retry_time
    private Date retryTime;
    //fail_type
    private String failType;
    @Column(value = "all_account_count")
    private Integer allAdAccountCount;
    private Integer allCampaignCount;
    @Column(value = "all_adset_count")
    private Integer allAdSetCount;
    @Column(value = "all_adgroup_count")
    private Integer allAdGroupCount;
    @Column(value = "all_adcreative_count")
    private Integer allAdCreativeCount;
    //continue_time
    private Long continueTime;

    public void setControl(Boolean control) {
        isControl = control;
    }

    public void setIsControl(Boolean control) {
        isControl = control;
    }
}
